UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+9EC0Y0r6tmhrJYTjhJruR9iFGajfs5XzUiZuCEGtkE=' 
WHERE 
  key_id = 'd1b9d322d1ddcbaa0ae5b0739cf5b945d1b8d40e34b5260ff728cc36370120b5' 
  AND (
    token = '+9EC0Y0r6tmhrJYTjhJruR9iFGajfs5XzUiZuCEGtkE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049