UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HBKsr53LFPUl0LNKobAxlPKOsbs21hR9BrFv8+EN/Kw='
WHERE
key_id = 'b2b1061ad91676a3da4949235817996fb8af63997a4741b7d05a788400769742'
AND (
token = 'HBKsr53LFPUl0LNKobAxlPKOsbs21hR9BrFv8+EN/Kw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)