UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qq/EcPQW/OVU4jPX6Ppgvt7TS/GpARm3jUFKUjUyBBo='
WHERE
key_id = '7da6e1a4f666a1afd7044fda2a5f1a1d54823d7267c5b1cf0385783ad7409db4'
AND (
token = 'qq/EcPQW/OVU4jPX6Ppgvt7TS/GpARm3jUFKUjUyBBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)