UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nW7pKtIdvMUJ9m1HOz8r4HTySooD/LySe7w3eRQW4BY='
WHERE
key_id = '6c3e0db1126deff03d3868362b869e4ff0381b67128cdc326017a5b1ae1321da'
AND (
token = 'nW7pKtIdvMUJ9m1HOz8r4HTySooD/LySe7w3eRQW4BY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)