UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vd2b5BjLkMaTfIs6BvVoDemqwrnlx3OQQJSVhZt1gPU=' 
WHERE 
  key_id = '053415cc82ec9da61d45dd7bd6adff4c877e3d9995572792a78b9c835796e95d' 
  AND (
    token = 'vd2b5BjLkMaTfIs6BvVoDemqwrnlx3OQQJSVhZt1gPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029