UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l6MpEIhXEEaHkBsNoAWGzBIL2qibyF5YlZCHxXcZ1yA=' 
WHERE 
  key_id = '7f4580473a9e50b5ae526af0a3b9f698bfbed2cb319f27963fc99a92f7922e75' 
  AND (
    token = 'l6MpEIhXEEaHkBsNoAWGzBIL2qibyF5YlZCHxXcZ1yA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020