UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZTKr8JBYut+2nKmBuzxftV10/TAcwbgDjoYow5FGUrY='
WHERE
key_id = '3f556f94a07087c69acb28b830bc77824cf3c65356fa6e771d6c791d9082b145'
AND (
token = 'ZTKr8JBYut+2nKmBuzxftV10/TAcwbgDjoYow5FGUrY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)