UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ukTAeKXGuxzIjLfDsBrFH6rZzK9cSPuWe3wfrTEi5Rw='
WHERE
key_id = '86e91f7fe186a3349b0fe37ba63ba403fe719289807740f2b4c915ead9d1ea4d'
AND (
token = 'ukTAeKXGuxzIjLfDsBrFH6rZzK9cSPuWe3wfrTEi5Rw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)