UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HNL1+XrUaYEt8LSPRSICGdOhsF9+28sy7TOP3D00jns='
WHERE
key_id = 'a23c51513084fc6b237a89f80227ca947bea1fd7fd17e2868a1ed390b08ec4f4'
AND (
token = 'HNL1+XrUaYEt8LSPRSICGdOhsF9+28sy7TOP3D00jns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)