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

Query time 0.00026