UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TLV1aQdO2m9QWGQJjhiqK+eFG1dm2HtX3EWzK9wY0SA='
WHERE
key_id = '3b83083f5219fb55ad9c28713cdcc99b2114d6c7f3d249534bfd036f4081b6e0'
AND (
token = 'TLV1aQdO2m9QWGQJjhiqK+eFG1dm2HtX3EWzK9wY0SA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)