UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VpgK+uz15Y/2w7PYU0LxbXbgTDClFFARPx5lCUTdSXg=' 
WHERE 
  key_id = '9c96172b5614c80b302aa61fb2aacfbdcc415e06ecfcbeaa0d913c164355cff7' 
  AND (
    token = 'VpgK+uz15Y/2w7PYU0LxbXbgTDClFFARPx5lCUTdSXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029