UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DO2GsNzFVA55w8GWgTDAMgIuuKKodH9O2IIRe5oUhFg='
WHERE
key_id = '9e1d21865a78d851d70edeb62b741430723413e0d6100c28e3a03b76087bb18d'
AND (
token = 'DO2GsNzFVA55w8GWgTDAMgIuuKKodH9O2IIRe5oUhFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)