UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aPMW/8owwl6frF4Bfzj2s7zZIwPWMfRoTPGDRUo8k9Y=' 
WHERE 
  key_id = '1aba60e4db3a9de3cc0193d7434be3811d7ea884041eea553eca1665d9f5c27a' 
  AND (
    token = 'aPMW/8owwl6frF4Bfzj2s7zZIwPWMfRoTPGDRUo8k9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021