UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MjlUmFFSuK6xN5k9gQquLCxbqZxf0PUIwhFTrdYWIbc=' 
WHERE 
  key_id = '98d1ecacc50615731830ef272738a8ab16791724fcf06e687d41b6b83d705a7d' 
  AND (
    token = 'MjlUmFFSuK6xN5k9gQquLCxbqZxf0PUIwhFTrdYWIbc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026