UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uqMlEwq9waubE/2rrBdR36fKU6eXLcWc3y/5i4/X+5I='
WHERE
key_id = '4fa9abfcefa5ad457a4b453dc283ca9c893effee2e53de97cd23c81aeaaac94d'
AND (
token = 'uqMlEwq9waubE/2rrBdR36fKU6eXLcWc3y/5i4/X+5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)