UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wCiqHDQVu28RdI22helubuLwgSerb3cMbJ6kN15cM08='
WHERE
key_id = '8bf8fc918c1f08c0368f16f17be570c21f5eb8e814455853b747c7f9515786e3'
AND (
token = 'wCiqHDQVu28RdI22helubuLwgSerb3cMbJ6kN15cM08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)