UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '45eqg+xei9JU4y9CY+EEC993xkgVENCriU4fCRHjt5g='
WHERE
key_id = '20d43653c9717f52b0523063fbbf26c4995134a835e4cdaf8b50268d84552f9c'
AND (
token = '45eqg+xei9JU4y9CY+EEC993xkgVENCriU4fCRHjt5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)