UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '42rCgmWjKTTLLzTHgksr4z4LZF9Z0KY1ISrFgUmROg8='
WHERE
key_id = 'cbb01698e9c9618558852a13c3c0d56a58ae101d80f760dbc2ce5f35f5110939'
AND (
token = '42rCgmWjKTTLLzTHgksr4z4LZF9Z0KY1ISrFgUmROg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)