UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dQEE7GUVqjox6+FsCJ++v/kSnvspHSnuE/CNqiCcqDA='
WHERE
key_id = '3b1632e4ff316f84f97deca204a7dcf876eb2610d15e7d824dd287890a29e4fe'
AND (
token = 'dQEE7GUVqjox6+FsCJ++v/kSnvspHSnuE/CNqiCcqDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)