UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j8rJ3OyiE5YRvcimLCqkeJssqQ5k+3AWNHhqrp1skdg='
WHERE
key_id = '96baf1f6add09369f71b8519f83d6a698af07de69eafd64cda2c567f7ea36d70'
AND (
token = 'j8rJ3OyiE5YRvcimLCqkeJssqQ5k+3AWNHhqrp1skdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)