UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/UYfzLqvzk5524n/4YyPbnlqbOwDmoxuSwwg51+MthU='
WHERE
key_id = '3d9853d2c7e1bf1d99299a32cee0886f4076f0c97e2040c461653c90046a1f7e'
AND (
token = '/UYfzLqvzk5524n/4YyPbnlqbOwDmoxuSwwg51+MthU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)