UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RyWZF38KzHV6QLq93hoiZXkN44dJZ+uZAFWBSx0QXDo=' 
WHERE 
  key_id = '79283eb84b84130497186a4fbe44bd539a2c4fd821b64d316e7bb2ff30240fa9' 
  AND (
    token = 'RyWZF38KzHV6QLq93hoiZXkN44dJZ+uZAFWBSx0QXDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047