UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S7VIby5kjHJCEwrVySs35LG1Cz+dMrza4ujTDUgnfsY='
WHERE
key_id = '14487e9cfe2327441f1db300ba4684ab82961d36330cf85fbe4579c0f1e41da2'
AND (
token = 'S7VIby5kjHJCEwrVySs35LG1Cz+dMrza4ujTDUgnfsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)