UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't+TBlL34wX8lO07iTKMGR79UnVBTg6b8ra+i7qwOGOU='
WHERE
key_id = '1375cea582a91e7606319ec18ebb6062ee1b75c63125827132c3b911c2227fd6'
AND (
token = 't+TBlL34wX8lO07iTKMGR79UnVBTg6b8ra+i7qwOGOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)