UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '75dkLmh4m6pmx0Sk5Q487NCXnvc4Fqw5x3AmocFOnsU=' 
WHERE 
  key_id = 'bf8d73eb068f2bff195fac397a18829eed94c0465ef561e74db44d9aae6f42f3' 
  AND (
    token = '75dkLmh4m6pmx0Sk5Q487NCXnvc4Fqw5x3AmocFOnsU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035