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

Query time 0.00041