UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xv7UtIGG63BJrEIWM6e63RMgzpK5w2p/7CdTQ+7ChOs=' 
WHERE 
  key_id = 'dfa870eabd640160537a7ca9032e92802cf0eed4a80d8574f0463fdf6a940c35' 
  AND (
    token = 'xv7UtIGG63BJrEIWM6e63RMgzpK5w2p/7CdTQ+7ChOs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016