UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9kkmpp4bZwBaUIfdP7rSzKJ5HPJHTiEwsOoz76zUOGQ='
WHERE
key_id = '11d5632201a0541cde59e41bc761c92a7d213493f34859eaf0087322a0992ab4'
AND (
token = '9kkmpp4bZwBaUIfdP7rSzKJ5HPJHTiEwsOoz76zUOGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)