UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ToDUl14JnzeONdWLUPGKUtta1jFNk/gjkm8SH3aBYI0='
WHERE
key_id = '7dfe5e37dbf459ba822c4844ab8e6ecbc43e5f4e92c8c48de5469ade3d76c106'
AND (
token = 'ToDUl14JnzeONdWLUPGKUtta1jFNk/gjkm8SH3aBYI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)