UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pdm2ipki1xQr/jjewFFvqhgiambL1X2S/GYvg5p+jeQ=' 
WHERE 
  key_id = '33cbeb4d7440bce839ab8cf6de8acbbe947ce34a93700c201d2646bcb63be5dd' 
  AND (
    token = 'Pdm2ipki1xQr/jjewFFvqhgiambL1X2S/GYvg5p+jeQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025