UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1g/faeWU2N1HCMDnlwtYkYTCipedTkzGSBiFQZlWM14=' 
WHERE 
  key_id = '2904e22b37808e5685a733a3d6db22bf5afcd181a55ce5fd58eebd6fdafa0c26' 
  AND (
    token = '1g/faeWU2N1HCMDnlwtYkYTCipedTkzGSBiFQZlWM14=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042