UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Ldj9PMTI5dIEcFQiW5bBMkxyB1c9su8qI8UUtl4rpw='
WHERE
key_id = '96952d3e3911ae02267fc33d469366438789851aef57a6c423ee35ba8a9d9685'
AND (
token = '7Ldj9PMTI5dIEcFQiW5bBMkxyB1c9su8qI8UUtl4rpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)