UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qaubd2zvo6WG8YHTqLp7VOrWpFnR/8sdYSC8E17nBMY='
WHERE
key_id = 'cfb4c258c5ae67ab4c884c17c88b21cb2332e041617a603346bd1e557db758ab'
AND (
token = 'qaubd2zvo6WG8YHTqLp7VOrWpFnR/8sdYSC8E17nBMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)