UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '21OsB9Z4HZkSiiraKm/f3IlXHsF8CrW86U9WSQ3YRCI='
WHERE
key_id = '7b0eb87b3d5447b1ca4ad49b760627450c73c504aa08b5e3eef9c06e95691637'
AND (
token = '21OsB9Z4HZkSiiraKm/f3IlXHsF8CrW86U9WSQ3YRCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)