UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6SUiOp9Nfq+lYgcsR5aSaij2lugfisNOgDNCpjPcvwU=' 
WHERE 
  key_id = '5a198d1104c1e6ad3fe4aa495e60068f611f812e2bb2c5ffd847794d586b9001' 
  AND (
    token = '6SUiOp9Nfq+lYgcsR5aSaij2lugfisNOgDNCpjPcvwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035