UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rZnSiAI2hz5s+up98zYV5Q+7/BGT4iDgmhcWs/YY35w=' 
WHERE 
  key_id = '33e41795f40ade1eff3309630ad94516c765085437c68f1bbeabef4f06f15dd6' 
  AND (
    token = 'rZnSiAI2hz5s+up98zYV5Q+7/BGT4iDgmhcWs/YY35w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045