UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bq61XKG7DT7buV0teA5SGyMenlWCWjwZUlsdfNMzqBs='
WHERE
key_id = 'bf30cd7689393bcb390050ccd635fc8e466f385aa05a6e2d6dbc1b6ccebf1bd0'
AND (
token = 'Bq61XKG7DT7buV0teA5SGyMenlWCWjwZUlsdfNMzqBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)