UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cbxnE6cV6InjjhrunT7yu0gc5wvzefz2JJD5xR9dQOA='
WHERE
key_id = '764cad07550877a0ae38d4f5e920bf437b477b126159d819627678651693d4ed'
AND (
token = 'cbxnE6cV6InjjhrunT7yu0gc5wvzefz2JJD5xR9dQOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)