UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZKfJqJiJtrqrXaKOakPasMgExCjtO8JwHyMq+uJpLbM=' 
WHERE 
  key_id = 'e8af931e6aadc995f9875e78b5ace7c282f95a27ec9b81e638df3a0541a07e37' 
  AND (
    token = 'ZKfJqJiJtrqrXaKOakPasMgExCjtO8JwHyMq+uJpLbM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045