UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0353Zgq9C4iCl/VsKibqhqMS5OoHr+UKKp8yzKK4w4E=' 
WHERE 
  key_id = '8295d931c0dec40b73f7fccba22a152c695c4acd4da84be0843979c7227e9287' 
  AND (
    token = '0353Zgq9C4iCl/VsKibqhqMS5OoHr+UKKp8yzKK4w4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028