UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VLeGLSHAUcWmRgo3UNq4whTnGM5s52C9sixa1NPJRXU='
WHERE
key_id = '65a87ff5b66ed87059c76d134345f7e6fe76cdb3f8ae58acffafcb8958b1e8f9'
AND (
token = 'VLeGLSHAUcWmRgo3UNq4whTnGM5s52C9sixa1NPJRXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)