UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BiCXd2TOylUEzmDNGMBg9n4sAQNk1BrHT0Lkivp3768='
WHERE
key_id = '0df9b9dafcb0d24e5d77c642951f0e36e4bf9f756687b82cb1c938d4dcc94a04'
AND (
token = 'BiCXd2TOylUEzmDNGMBg9n4sAQNk1BrHT0Lkivp3768='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)