UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't7yL+dePw/2FVDWEnQdnGSyc9xTv3YX/cG1ZQ18U9Hg=' 
WHERE 
  key_id = '526a4fa33c7cdd40aca1a4ac380d4fbf2846f87115efce383df38bd03f02f46f' 
  AND (
    token = 't7yL+dePw/2FVDWEnQdnGSyc9xTv3YX/cG1ZQ18U9Hg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016