UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cfJ3LHf5FVk9N36C0XTC8UOGk47Wf/Hx5HbfbZgBSS8=' 
WHERE 
  key_id = 'cd06730e640f2e06b10bd645ccf48665a72fb047db6a85aa98ebe0476efd1617' 
  AND (
    token = 'cfJ3LHf5FVk9N36C0XTC8UOGk47Wf/Hx5HbfbZgBSS8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020