UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ivmq0YDb4KiTD1wGvdm8O6F7aJH1wtQ8zVG30jYhTms='
WHERE
key_id = '6778b0046bd04f0798bcc08ad86a1afefd55bd71c40c095bdb7b547c6518864a'
AND (
token = 'Ivmq0YDb4KiTD1wGvdm8O6F7aJH1wtQ8zVG30jYhTms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)