UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6mmlheRO9apy3ZOIGQPJmbRwiiJuSRmGPtHKY2/zZAU=' 
WHERE 
  key_id = 'a04dde61938fe2391dd3d39fd7385ab0a0d8cdb670685c1e79a3d03fc03da6f6' 
  AND (
    token = '6mmlheRO9apy3ZOIGQPJmbRwiiJuSRmGPtHKY2/zZAU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018