UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qbutf1VzgsYARHaYv/3/3s/8PkXbOgeDqnvPVm3Gepg='
WHERE
key_id = '9172acc20bc5642d725750a65704c3691fba7e125ef8e840924baed977f92e15'
AND (
token = 'qbutf1VzgsYARHaYv/3/3s/8PkXbOgeDqnvPVm3Gepg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)