UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5/tutMrAMxvp3aJWNI9hqDVhUvWAhKONNnodp6Vn8kA=' 
WHERE 
  key_id = 'ecd5053966c9c3a62b4d29f380860df476fd2b9e872222a33c545499195cc621' 
  AND (
    token = '5/tutMrAMxvp3aJWNI9hqDVhUvWAhKONNnodp6Vn8kA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019