UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IwW9Ae86iaHfQaJ5R651Z0Ob4c5qMQAk/aQ6wPq/GOI=' 
WHERE 
  key_id = 'e2d1c6deeff2eeeee99056b78d31002a1d85be20ee59d77cf7a7fb640c9da658' 
  AND (
    token = 'IwW9Ae86iaHfQaJ5R651Z0Ob4c5qMQAk/aQ6wPq/GOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020