UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7upxJAve3TFfblsq4xvOwQw69IAHv1OJnW0WLJ0xiMk='
WHERE
key_id = '35aa2296cc5d011af86b87acaf44bfcacd809d0a4c796a03d6ea66198efcffe4'
AND (
token = '7upxJAve3TFfblsq4xvOwQw69IAHv1OJnW0WLJ0xiMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)