UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8U7M1bV8BGoZ45CfEi1PA/1kexp8d39jmIsuMk2SNCA='
WHERE
key_id = '308a0da66011e3de1243fb30e4b9752124ebbb2b41630c1af61bbff4692d7b1a'
AND (
token = '8U7M1bV8BGoZ45CfEi1PA/1kexp8d39jmIsuMk2SNCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)