UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'swmXBB3ziWNCSid02YpU0AS2sGSa2JjG3CW5Ld8FEOo=' 
WHERE 
  key_id = '2dd11b329955ce42f9a07f82ca4d4dc44ed443c494b26e541cd0d79fddb0d02e' 
  AND (
    token = 'swmXBB3ziWNCSid02YpU0AS2sGSa2JjG3CW5Ld8FEOo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029