UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N1hTPg8XfHln1Hd2ah6OacJNNsXmcMknC5HS7gNLcRE=' 
WHERE 
  key_id = '61c84ad0ea31c5e870313b15f9ebd2503a8b178cf90cd9c86741e6c4953e6452' 
  AND (
    token = 'N1hTPg8XfHln1Hd2ah6OacJNNsXmcMknC5HS7gNLcRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035