UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jUGJ35sJHWDmxhEujQkgm2WhLnX8vlQFOxBTVlXlwOc='
WHERE
key_id = 'a91811f78079777a67337d96f08e4af003dab9383e5b8afda35acee22e9908e2'
AND (
token = 'jUGJ35sJHWDmxhEujQkgm2WhLnX8vlQFOxBTVlXlwOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)