UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gXkgxGdx0TmTP1MaxY6IxTsWBTfV5EgFJsgedZm5BvQ=' 
WHERE 
  key_id = 'fd2938f9a6b9a5f3bd70a9b671d35c8b59c134b71480a4654be94a3f9eed0aaa' 
  AND (
    token = 'gXkgxGdx0TmTP1MaxY6IxTsWBTfV5EgFJsgedZm5BvQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023