UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rzZXEEvqLSMtyvrmL00+bkWoJHbZSrawFTvjvlH4lak=' 
WHERE 
  key_id = '6394d4462f4f36bd41f1fc249d034228c69ce1659623eaa2ba8bf26264551c2e' 
  AND (
    token = 'rzZXEEvqLSMtyvrmL00+bkWoJHbZSrawFTvjvlH4lak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029