UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C1KL5Wcibk6ZZcjmOQnAulXe/t8qE1j0P731/TZ7cfI=' 
WHERE 
  key_id = '5a3d91bb47bdc3633052ca3d8abefd0e20d8841627b523d2ae3ff6e8bdd3791c' 
  AND (
    token = 'C1KL5Wcibk6ZZcjmOQnAulXe/t8qE1j0P731/TZ7cfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047