UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jS4XQF2PFDavE7oWx+OdbBocN/FTECuac7kqAZ/skNQ=' 
WHERE 
  key_id = '1de2bfef64121ccec3b6acd29814b89116aa6f76d766714dad4428480b76ac68' 
  AND (
    token = 'jS4XQF2PFDavE7oWx+OdbBocN/FTECuac7kqAZ/skNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044