UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kGiNksERENCeeZ5ZK4/71wBBHge53sL+CrLsiGWVVho=' 
WHERE 
  key_id = 'c83d5a8da511763df9b648b45de0437c3551ea0011ba027659e66004f5410933' 
  AND (
    token = 'kGiNksERENCeeZ5ZK4/71wBBHge53sL+CrLsiGWVVho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015