UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yul482l4tJXJQ/vRNENzJHwytdBQ1t0gOwSEPt4lpnk='
WHERE
key_id = '7e785e16b45e1a6fda159ae721152bd8c24f4743d8aa7fed7496a1522aa9d9fc'
AND (
token = 'Yul482l4tJXJQ/vRNENzJHwytdBQ1t0gOwSEPt4lpnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)