UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mP03i0VuhoDKpCeOc/FkNiXl0gwUXrms/fjKx/tSPjQ='
WHERE
key_id = '9829bd79aa82ae4419c52ddf45c5c85b5cd51c896219280c29b3da29d40c5c1a'
AND (
token = 'mP03i0VuhoDKpCeOc/FkNiXl0gwUXrms/fjKx/tSPjQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)