UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LLgHZlcJ+iPEeY33u0JbJF4Chvp/lKlGyKn6nhx0/TE=' 
WHERE 
  key_id = '73311af6141d4ef4dad215f72a6b4c764b1903554c98ba85f3c6ffa5c95abec4' 
  AND (
    token = 'LLgHZlcJ+iPEeY33u0JbJF4Chvp/lKlGyKn6nhx0/TE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018