UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rU3Y1WJslX/DYNjMcbJR3I2VurNl6NdFvpjBpovDWgA=' 
WHERE 
  key_id = '680c883d908581a3c720d627272801252284904b8080f8ae79fca844f5c0bc77' 
  AND (
    token = 'rU3Y1WJslX/DYNjMcbJR3I2VurNl6NdFvpjBpovDWgA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034